package com.penghaisoft.microwms.material.web.expose.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.penghaisoft.microwms.common.controller.BaseController;
import com.penghaisoft.microwms.common.dto.TransResult;
import com.penghaisoft.microwms.common.page.Pager;
import com.penghaisoft.microwms.common.wms.model.RawCarCheckIn;
import com.penghaisoft.microwms.common.wms.model.RawStorageSn;
import com.penghaisoft.microwms.material.web.intowarehouse.service.IMaterialIntoService;
import com.penghaisoft.microwms.material.web.intowarehouse.service.IRawCarCheckInService;

/**
 * @Package com.penghaisoft.microwms.material.web.expose.controller
 * @ClassName: ExposeScreenController
 * @Description: 大屏
 * @author luoteng
 * @date 2018年11月22日 下午2:58:18
 */
@RestController
@RequestMapping(value = "/expose/screen")
public class ExposeScreenController extends BaseController {

	@Autowired
	private IMaterialIntoService materialIntoService;
	
	@Autowired
	private IRawCarCheckInService iRawCarCheckInService;

	/**
	 * @Title listIntoWhModelType
	 * @Description 原材料入库型号统计明细
	 * @author luoteng
	 * @date 2018年5月24日:下午2:59:43
	 * @param ob
	 * @return TransResult
	 */
	@PostMapping("modeltype/intowh/list")
	public TransResult listIntoWhModelType(@RequestParam(name = "page", defaultValue = "1") int page,
			@RequestParam(name = "rows", defaultValue = "10") int rows, RawStorageSn rawStorageSn) {
		Pager<RawStorageSn> result = materialIntoService.listIntoWhModelType(page, rows, rawStorageSn);
		return success(result);
	}
	
	/**
	 * @Title listIntoWhModelType
	 * @Description 原材料入库型号统计明细
	 * @author luoteng
	 * @date 2018年5月24日:下午2:59:43
	 * @param ob
	 * @return TransResult
	 */
	@PostMapping("modeltype/intowh/list/new")
	public TransResult listIntoWhModelTypeNew(@RequestParam(name = "page", defaultValue = "1") int page,
			@RequestParam(name = "rows", defaultValue = "10") int rows, RawCarCheckIn rawCarCheckIn) {
		Pager<RawCarCheckIn> result = iRawCarCheckInService.findListByConditionNew(page, rows, rawCarCheckIn);
		return success(result);
	}
}
